<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>百媚后花园</title>
    <script src="../base/js/jquery-1.10.2.js"></script>
    <link rel="stylesheet" href="../base/css/weui.css">
    <style>
        body {
            background-color: #fbf9fe;
        }
        .page_title {
            text-align: center;
            font-size: 34px;
            color: #3cc51f;
            font-weight: 400;
            margin: 20px 15% 0;
        }

        .m{
            margin-top: 40px;
        }
    </style>
</head>
<body ontouchstart="">
    <h1 class="page_title">Back Garden (Scheme)</h1>

    <section class="m">
        <div class="weui_cells_title">首页</div>
        <div class="weui_btn_area">
            <a href="bmlive://bmlive/home?id=0" class="weui_btn weui_btn_primary">快看</a>
            <a href="bmlive://bmlive/home?id=1" class="weui_btn weui_btn_primary">星动态</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">直播间</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">*id</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入id" data-target="value" data-key="id">
                </div>
            </div>
            <div class="weui_cell weui_cell_switch">
                <div class="weui_cell_hd weui_cell_primary">是否为嘉宾</div>
                <div class="weui_cell_ft">
                    <input class="weui_switch" type="checkbox" data-target="checked" data-key="tag">
                </div>
            </div>
        </div>
        <div class="weui_cells_tips">带 * 为必填项</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="javascript:" data-action="bmlive://bmlive/live">去直播间</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">发起直播</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">标题</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入标题" data-target="value" data-key="title">
                </div>
            </div>

            <div class="weui_cell weui_cell_switch">
                <div class="weui_cell_hd weui_cell_primary">是否允许给嘉宾送礼</div>
                <div class="weui_cell_ft">
                    <input class="weui_switch" type="checkbox" data-target="checked" data-key="canGift">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="javascript:" data-action="bmlive://bmlive/applylive">开启直播</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">个人空间</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">用户id</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入用户id" data-target="value" data-key="id">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="javascript:" data-action="bmlive://bmlive/userspace">去个人空间</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">发布视频</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">文本</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入文本" data-target="value" data-key="text">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="javascript:" data-action="bmlive://bmlive/uploadvideo">发布视频</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">登录</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="bmlive://bmlive/login">登录</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">设置</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="bmlive://bmlive/setting">设置</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">动态详情</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">*动态id</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入动态id" data-target="value" data-key="id">
                </div>
            </div>
        </div>
        <div class="weui_cells_tips">带 * 为必填项</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" data-action="bmlive://bmlive/dynamicdetail">查看动态</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">活动详情</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">*活动id</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入活动id" data-target="value" data-key="id">
                </div>
            </div>
        </div>
        <div class="weui_cells_tips">带 * 为必填项</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" data-action="bmlive://bmlive/act">查看活动</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">我的关注</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">用户id</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入用户id" data-target="value" data-key="id">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" data-action="bmlive://bmlive/follow">查看关注</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">我的粉丝</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">用户id</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入用户id" data-target="value" data-key="id">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" data-action="bmlive://bmlive/fans">查看粉丝</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">星豆贡献榜</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">用户id</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入用户id" data-target="value" data-key="id">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" data-action="bmlive://bmlive/contributionlist">查看星豆榜</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">发布图文</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">文本</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入文本" data-target="value" data-key="text">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" data-action="bmlive://bmlive/uploadtxpic">立刻发布</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">我的星豆</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="bmlive://bmlive/myxtcurrency">我的星豆</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">我的收益</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="bmlive://bmlive/myincome">我的收益</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">我的消息</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="bmlive://bmlive/mymsg">我的消息</a>
        </div>
    </section>

    <section class="m" data-web='true'>
        <div class="weui_cells_title">打开webview</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="text" placeholder="请输入url" data-target="url" data-key="url">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="javascript:" data-action="bmlive://bmlive/web">打开网页</a>
        </div>
    </section>

    <section class="m" data-web='true'>
        <div class="weui_cells_title">更多话题</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="javascript:" data-action="bmlive://bmlive/moreTopic">更多话题</a>
        </div>
    </section>

    <section class="m" data-web='true'>
        <div class="weui_cells_title">我的消息</div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" href="javascript:" data-action="bmlive://bmlive/mymsg">我的消息</a>
        </div>
    </section>

    <section class="m">
        <div class="weui_cells_title">游戏房间</div>
        <div class="weui_cells weui_cells_form">
            <div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">密码</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" type="password" placeholder="请输入密码" data-target="value" data-key="password">
                </div>
            </div>
        </div>
        <div class="weui_btn_area">
            <a class="weui_btn weui_btn_primary" data-action="bmlive://bmlive/gameRoom">进入</a>
        </div>
    </section>
    <script>
        $(function () {
            $('.m').each(function  () {
                var $this = $(this);
                $this.find('[data-action]').on('click', function(event) {
                    event.preventDefault();
                    var arr = [];
                    var isTesting ='no';
                    var url = $(this).data('action');

                    $this.find('[data-target]').each(function (num) {
                        var item = $(this);
                        var value = '';
                        var key = item.data('key');

                        if(!key) return;

                        switch(item.data('target')) {
                            case 'checked':
                                value = +item.prop('checked');
                                break;

                            case 'value':
                                value = encodeURIComponent(item.val());
                                break;

                            case 'url':
                                var str = '';
                                var url = encodeURIComponent(item.val());
                                value = url ? url + str : '';
                                break;
                        }

                        if(value !== '') {
                            arr.push(key+'='+value);
                        }
                    })
                    console.log(url+'?'+arr.join('&'))
                    window.location.href = url+'?'+arr.join('&');
                });
            })
        })
    </script>
</body>
</html>
